package com.zz.nondatain.model;

import com.google.gson.annotations.SerializedName;

/**
 * 百度AI平台Token响应模型
 * 参考文档: https://ai.baidu.com/ai-doc/REFERENCE/Ok3zxz32l
 */
public class BaiduTokenResponse {
    
    @SerializedName("refresh_token")
    private String refreshToken;
    
    @SerializedName("expires_in")
    private long expiresIn;
    
    @SerializedName("scope")
    private String scope;
    
    @SerializedName("session_key")
    private String sessionKey;
    
    @SerializedName("access_token")
    private String accessToken;
    
    @SerializedName("session_secret")
    private String sessionSecret;
    
    // 错误信息
    @SerializedName("error")
    private String error;
    
    @SerializedName("error_description")
    private String errorDescription;
    
    public String getRefreshToken() {
        return refreshToken;
    }
    
    public long getExpiresIn() {
        return expiresIn;
    }
    
    public String getScope() {
        return scope;
    }
    
    public String getSessionKey() {
        return sessionKey;
    }
    
    public String getAccessToken() {
        return accessToken;
    }
    
    public String getSessionSecret() {
        return sessionSecret;
    }
    
    public String getError() {
        return error;
    }
    
    public String getErrorDescription() {
        return errorDescription;
    }
    
    public boolean hasError() {
        return error != null && !error.isEmpty();
    }
    
    @Override
    public String toString() {
        return "BaiduTokenResponse{" +
                "accessToken='" + accessToken + '\'' +
                ", expiresIn=" + expiresIn +
                ", refreshToken='" + refreshToken + '\'' +
                ", scope='" + scope + '\'' +
                ", error='" + error + '\'' +
                ", errorDescription='" + errorDescription + '\'' +
                '}';
    }
} 